class InspectMe {
	int outer() {
		return inner()
	}

	private int inner() {
		return 1
	}
}

// 实例化一个拦截器
def tracer = new TracingInterceptor(writer: new StringWriter())

def proxyMetaClass = ProxyMetaClass.getInstance(InspectMe)

// 添加拦截器
proxyMetaClass.interceptor = tracer

InspectMe inspectMe = new InspectMe()
// 给 InspectMe 添加 ProxyMetaClass
inspectMe.metaClass = proxyMetaClass

assert inspectMe.outer() == 1
println tracer.writer.toString()
